package com.yidu.best.bond.cashArap.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yidu.best.bond.cashArap.dao.CashArapDao;
import com.yidu.best.bond.cashArap.domain.CashArap;
import com.yidu.best.bond.cashArap.domain.CashArapVo;
import com.yidu.best.bond.cashArap.service.CashArapService;

@Service
public class CashArapServiceImpl implements CashArapService{
	@Autowired
	private CashArapDao cashArapDao;

	@Override
	public Map<String, Object> findPageQuery(CashArapVo CashArapVo) {
		// 调用dao层方法查询数量
		int count = cashArapDao.countCashArap(CashArapVo);
		// 计算页码
		int page = (CashArapVo.getPage() - 1) * CashArapVo.getLimit();
		CashArapVo.setPage(page);
		// 调用dao层方法分页查询
		List<CashArap> capitalTransferList = cashArapDao.findPageQuery(CashArapVo);
		Map<String, Object> map = new HashMap<String, Object>();
		// 将数据存入map中
		map.put("code", 0);
		map.put("count", count);
		map.put("data", capitalTransferList);
		return map;
	}
}
